#ifndef PHONE_FLY_H
#define PHONE_FLY_H

#include <QtCore/QtGlobal>

#include <QMainWindow>

#include <QtSerialPort/QSerialPort>
#include <QLabel>
#include <QSpinBox>


#include "ui_phone_fly.h"

class Console;
class SettingsDialog;
class GLWidget;
class Phone_fly : public QMainWindow
{
	Q_OBJECT

public:
	Phone_fly(QWidget *parent = 0);
	~Phone_fly();
	
	
private slots:
    void openSerialPort();
    void closeSerialPort();
    void about();

    void writeData(const QByteArray &data);
	void setController(bool);

    //! [7]
    void readData();
    void handleError(QSerialPort::SerialPortError error);

    void setBoundaryVisible(bool );

private:
    void initActionsConnections();

private:
	GLWidget *openGL;
    Ui::MainWindow *ui;
    Console *console;
    SettingsDialog *settings;
    QSerialPort *serial;
    QLabel* label;
    QByteArray buffer;
};

#endif // PHONE_FLY_H
